package com.campus.web.controller;

import com.alibaba.fastjson.JSON;
import com.campus.app.service.CloudFilesService;
import com.campus.commons.entity.CloudFile;
import com.campus.commons.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 文件下载 前端控制器
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@RestController
@RequestMapping("/CloudFile")
public class CloudFileController {
    @Autowired
    private CloudFilesService cloudFilesService;

    @RequestMapping("/all")
    public Result<List<CloudFile>> getAllById(int page,int limit,int deId) {
        Result<List<CloudFile>> file = cloudFilesService.getFile(page, limit, deId);
        return file;
    }

    @RequestMapping("/all_byTime")
    public Result<List<CloudFile>> getAllByTime(int page,int limit ,int deId, String Time) {
        Result<List<CloudFile>> all = cloudFilesService.getAllByTime(page, limit, Time, deId);
        return all;
    }

}
